<?php

//process admin ajax to delete cache
add_action('wp_ajax_arihost_delete_cache', 'delete_airhost_cache');
add_action('wp_ajax_nopriv_arihost_delete_cache', 'delete_airhost_cache');
function delete_airhost_cache() {
	if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'delete_cache_nonce')) {
		die('Security check failed');
	}
	delete_transient('room_booking_result');
	wp_send_json_success('Cache deleted', 200);
	wp_die();
}